<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<input type="text" id="text">
<input value="开始测试" type="button" onclick="method()">

</body>

<script>

    function method() {
        var elementById = document.getElementById("text");
        var arr = elementById.value.split("");
        var boo = true;
        if (arr.length == 1) {
            alert("不对称")
            return
        }
        for (var i = 0; i < arr.length / 2; i++) {
            if (parseInt(arr[i]) != parseInt(arr[arr.length - 1 - i])) {
                boo = false;
                break;
            }
        }
        if (boo) {
            alert("对称")
        } else {
            alert("不对称")
        }
    }
</script>
</html>